package com.example.jpa.controller;

import com.example.jpa.entity.Student;
import com.example.jpa.service.StudentService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class StudentController
{
    @Resource
    StudentService studentService;

    @PostMapping("/save")
    public void add1(Student student){
        student.setName("贾春雷");
        student.setAge(14);
        student.setSex("男");
        student.setUsername("朝花不迟暮");
        student.setPassword("123456");
        studentService.addStudent(student);
    }
}
